//
//  LSExpertRankBaseViewController.m
//  LookScore
//
//  Created by wr on 2018/5/5.
//  Copyright © 2018年 ChongQingXunTiCompany. All rights reserved.
//

#import "LSExpertRankBaseViewController.h"
#import "LSExpertRankViewController.h"
#import "ZJScrollPageView.h"

@interface LSExpertRankBaseViewController ()<ZJScrollPageViewDelegate>

@property(strong, nonatomic)NSArray<NSString *> *titles;

@property(strong, nonatomic)NSArray<UIViewController *> *childVcs;

@property (nonatomic, strong) ZJScrollPageView *scrollPageView;

@property(strong,nonatomic)NSArray *allExpertRankListArr;

@end

@implementation LSExpertRankBaseViewController
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = NO;
    self.navigationController.navigationBar.translucent = NO;
    self.navigationController.navigationBar.alpha = 1 ;
}


-(NSArray *)allExpertRankListArr{
    if (!_allExpertRankListArr) {
        _allExpertRankListArr = @[].mutableCopy;
    }
    return _allExpertRankListArr;
}

- (void)viewDidLoad {
    [super viewDidLoad];
//    self.title=@"专家排行";
    self.view.backgroundColor = [UIColor whiteColor];
    [self initUI];
    [self loadLSExpertRankList];
}

- (void)initUI{
    
    
    
    ZJSegmentStyle *style = [[ZJSegmentStyle alloc] init];
    //显示滚动条
    style.showLine = YES;
    // 颜色渐变
    style.gradualChangeTitleColor = YES;
    
    style.scrollLineColor=LSNavMainColor;
    
    style.segmentHeight=35;
    
    style.autoAdjustTitlesWidth=YES;
    
    style.normalTitleColor=[UIColor colorWithRed:255.f/255.f green:255.f/255.f blue:255.f/255.f alpha:1];
    
    style.selectedTitleColor=LSNavTitlenColor;
    
    style.scrollLineColor=LSNavTitlenColor;
    
    self.titles = @[@"连红排行榜",@"盈利排行榜",@"胜率排行榜"];
    // 初始化
    _scrollPageView = [[ZJScrollPageView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width,self.view.bounds.size.height) segmentStyle:style titles:self.titles parentViewController:self delegate:self];
    _scrollPageView.segmentView.backgroundColor=LSNavMainColor;
    _scrollPageView.backgroundColor = [UIColor redColor];
    [self.view addSubview:_scrollPageView];
}
-(void)loadLSExpertRankList{
//    [LSHttpEnclosureTool GET:LSAllLeagueList parameters:nil resBlock:^(id responseObject) {
//        if (responseObject) {
//            self.allLeagueListArr = responseObject;
//            [self initUI];
//        }
//    }];
}

- (NSInteger)numberOfChildViewControllers {
    return self.titles.count;
}

- (UIViewController<ZJScrollPageViewChildVcDelegate> *)childViewController:(UIViewController<ZJScrollPageViewChildVcDelegate> *)reuseViewController forIndex:(NSInteger)index {
//    NSArray *leagueListArr = [self dataClassification:index].copy;
    UIViewController<ZJScrollPageViewChildVcDelegate> *childVc = reuseViewController;
    
    if (!childVc) {
        LSExpertRankViewController *ERVC = [[LSExpertRankViewController alloc] init];
//        IMVC.leagueListArr = leagueListArr;
        childVc = ERVC;
    }
    
    return childVc;
}



- (BOOL)shouldAutomaticallyForwardAppearanceMethods {
    return NO;
}


@end
